msg_tool\scripts\escude\ops/
base.rs

1use super::super::script::{ReadParam, VM};
2use crate::ext::io::*;
3use anyhow::Result;
4
5pub trait CustomOps<T: std::fmt::Debug + TryInto<u64>>: std::fmt::Debug {
6    fn run<'a>(&mut self, vm: &mut VM<'a, T>, op: u8) -> Result<bool>
7    where
8        MemReaderRef<'a>: ReadParam<T>,
9        T: TryInto<u64>
10            + Default
11            + Eq
12            + Ord
13            + Copy
14            + std::fmt::Debug
15            + std::fmt::Display
16            + std::hash::Hash
17            + From<u8>
18            + std::ops::Neg<Output = T>
19            + std::ops::Add<Output = T>
20            + std::ops::Sub<Output = T>
21            + std::ops::Mul<Output = T>
22            + std::ops::Div<Output = T>
23            + std::ops::Rem<Output = T>
24            + std::ops::Not<Output = T>
25            + std::ops::BitAnd<Output = T>
26            + std::ops::BitOr<Output = T>
27            + std::ops::BitXor<Output = T>
28            + std::ops::Shr<Output = T>
29            + std::ops::Shl<Output = T>,
30        anyhow::Error: From<<T as TryInto<u64>>::Error>;
31}